package com.xj.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TimeUtil {
    /*  9 */   private static final Logger log = LoggerFactory.getLogger(TimeUtil.class);


    public static String dateToStr(Date date) {
        try {
            /* 15 */
            String format = "yyyy-MM-dd HH:mm:ss.SSS";
            /* 16 */
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            /* 17 */
            String str = sdf.format(date);

            /* 19 */
            return str;
        }
        /* 21 */ catch (Exception e) {
            /* 22 */
            log.error("Date类型的时间:" + date + "转换为String类型时失败", e);

            /* 24 */
            return null;
        }
    }


    public static boolean containsMilliseconds(String timeStr) {
        /* 31 */
        return timeStr.matches(".*\\d{2}:\\d{2}:\\d{2}\\.\\d{3}");
    }
}


/* Location:              C:\Users\Administrator\Desktop\fsdownload\ie-data.jar!\BOOT-INF\lib\ie-base-1.0-SNAPSHOT.jar!\com\xj\commo\\utils\TimeUtil.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */